package spring.controller;

import spring.dao.OrderDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author:CoolTiger
 * @description: TODO
 * @date:2024/04/24/23:29:45
 **/
public class AppOrderFactory {
    public static void main(String[] args) {
        //静态工厂创建对象
//        OrderDao orderDao = OrderDaoFactory.getOrderDao();
//        orderDao.save();

        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        OrderDao orderDao = (OrderDao) ctx.getBean("orderDao");
        orderDao.save();
    }
}
